import request from 'alinesno-ui/src/utils/request'

var prefix = 'com/alinesno/cloud/business/GitOperation/';

var managerUrl = {
  unBing: prefix + "unBing",
  bingFormGitlab: prefix + "bingFormGitlab",
  getGitGroups: prefix + "getGitGroups",
  gitGroupsDatatables: prefix + "gitGroupsDatatables",
  getGithubAuthurl: prefix + "getGithubAuthurl",
}

// 获取应用列表
export function unBing(id , gitType) {
  return request({
    url: managerUrl.unBing + "?id=" + id + "&gitType=" + gitType,
    method: 'get',
  })
}

// 获取github绑定链接
export function getGithubAuthurl(gitType){
  return request({
    url: managerUrl.getGithubAuthurl + "?gitType=" + gitType, 
    method: 'get',
  })
}

// 保存gitlab绑定
export function bingFormGitlab(data) {
  return request({
    url: managerUrl.bingFormGitlab,
    method: 'put',
    data: data
  })
}

// 获取git分组
export function getGitGroups(gitId) {
  return request({
    url: managerUrl.getGitGroups + "?id=" + gitId,
    method: 'get',
  })
}

// 查询【git分组】列表
export function gitGroupsDatatables(query , data ,selectGit) {
  return request({
    url: managerUrl.gitGroupsDatatables + "?selectGit=" + selectGit ,
    method: 'post',
    params: query ,
    data: data
  })
}